home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 5
/
Gold Medal Software - Volume 5 (Gold Medal) (1995).iso
/
utils1
/
gsr162.arj
/
GSR.DOC
next >
Wrap
Text File
|
1994-09-04
|
15KB
|
433 lines
GGGGGGGGGG SSSSSSSSSS RRRRRRRRR tm
G G S R R
G S R R
G S R R
G SSSSSSSSSS RRRRRRRRR
G GGG S R R
G G S R R
G G S R R
GGGGGGGGGG SSSSSSSSSS R R
Global Search Replace
Version 1.62
The Programmers Scalpel! tm
Copyright 1990:1994 Phil Barnett. All Rights Reserved
GSR and all of its' associated files are Shareware.
'The Programmers Scalpel' and 'GSR' are tm Phil Barnett
GSR is Copyrighted. Please feel free to give this program to anyone who uses
a DOS based computer as long as it is distributed in unmodified and complete
form.
It requires DOS 3.0 or later. It works fine with DR-DOS 6.0 and MSDOS 6.x.
You may use GSR for 2 weeks at no charge.
Registration fee is $20.00. Please make checks payable to Phil Barnett.
This is an absolutely complete version.
****************************************
* Phil Barnett (407) 884-5192 *
* 1105 Binion *
* Apopka, Fl 32703 *
****************************************
When you register this program I will mail you the latest version which will
have the registration form removed from the exiting screen.
INSTALLATION INSTRUCTIONS
You may place GSR in any directory, however it is easier to use if you
place it in a directory which is in the path statement of your autoexec.bat.
GSR includes four files.
1 GSR.EXE The Executable Program
2 GSRAVOID.DBF A table of special extensions (explained below)
3 GSR.DOC This Document
4 GSR.SDA A short description of the program.
!!!!!!!!!! IMPORTANT !!!!!!!!!!! READ THIS !!!!!!!!!!
YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
BEFORE YOU BEGIN WITH GSR.
YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
BEFORE YOU BEGIN WITH GSR.
YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
BEFORE YOU BEGIN WITH GSR.
Even though every precaution has been taken to insure it's safe use, the
potential for unrecoverable change exists in any program of this kind.
GSR keeps the last 99 versions of what you are working on.
Of course, you should back up everything so often
as to make this warning unnecessary!
!!!!!!!!!!!!!!!!!!!!!!!!! ALWAYS make a backup first !!!!!!!!!!!!!!!!!!!!!!!!!
Manual for GSR Version 1.62
Version 1.4 and up have Virtual file handling capabilities. This allows GSR
to run in less memory, and process unlimited file size.
GSR is a Global Search and Replace program. It allows you to select a group
of files to operate on. You can then specify what text to look for, and what
text to replace it with. Your search can be either case sensitive or not,
and you may either view each occurrence, to verify the change, or have GSR
automatically make all replacements for you.
Probable uses are:
Rename an existing variable or function across many modules.
Change a copyright notice.
Change a client name when you are recycling code.
Convert from one language version to another
and many more.....
Setup options are entered into blanks after you run the program.
You may press <Esc> at any time, to stop the process. The file you are
operating on at the time will remain unchanged. Files you have already
confirmed changes on will remain changed.
When you see the field labeled "File Spec to Include" you should enter the
type of file you wish to perform global operations on. Typical response might
be;
*.C
*.PRG
*.BAT
*.BAS
*.TXT
XXX*.XXX
FORM??.ABC
etc.
The next field you enter is 'String to Search for'. This is where
you enter the text you are wishing to replace. If you need to replace text
that is longer than 76 characters, or you wish to include carriage return
linefeed combinations, you may use an input file instead. Place the filename
in <> like this: <lookfor.txt> as the only item in the field.
(you can use any filename here, lookfor.txt is only an example)
The next field you enter is 'String to Replace with'. This is the
text you wish to replace the above field with. You may also use an input file
here by placing the replacement text in a file and specifying it's name
in <> like this: <a:\repwith.txt> as the only item in the field.
(you can use any filename here, a:\repwith.txt is only an example)
Your next option is '(M)anual or (A)utomatic'. If you select automatic mode,
the search and replace operation will complete without further intervention.
If you are unsure of the consequences of this action at all, you should use
manual mode instead. Manual mode will present you with each occurrence
with its contextual suroundings. You can decide what to do with each
occurrence individually.
Your last option is to make GSR search for your text regardless of the case.
If you choose 'Case Sensitive' = 'N', capitalization will have no bearing on
your search.
pHiL will find PHIL
xxxxxx will find XXXXXX
PHIL will find phil
copyright 1990 will find Copyright 1990
etc.
After you have set up the five primary fields, you will be presented with
a summary screen of selections. This will allow you to review your setup
and abort the process if you were mistaken in any way.
When you confirm your setup, the search will begin.
If you selected manual mode, each occurrence of the searched for text will be
displayed in context as it is found. You will be asked:
Replace this occurrence? (Y/N)
If you select Y, it will be replaced, and the search will continue. If you
select N, the search will continue with no changes to the file.
When you have reached the end of the file, and you have previously selected to
replace an occurrence, you will receive one final prompt:
Make Changes to FILENAME.EXT Permanent? (Y/N)
If you select Y, your changes will be written. If you select N, any changes you
have already selected on this file will be ignored.
In any case, if you choose to make the replacements, your original text will
be renamed with the extension .GSR. Subsequent changes will increment the .GSR
extension, with up to 99 changes kept on any single file name.
MYTEXT.GSR
MYTEXT.GS1
MYTEXT.GS2
MYTEXT.GS3
MYTEXT.GS4
MYTEXT.GS5
MYTEXT.GS6
MYTEXT.GS7
MYTEXT.GS8
MYTEXT.GS9
MYTEXT.G10
MYTEXT.G11
MYTEXT.G12
MYTEXT.G13
MYTEXT.G14
MYTEXT.G15
up to
MYTEXT.G99
99 previous versions are kept until you choose to delete them. This is going
to create a lot of backups, but is necessary due to the tremendous power of
this program.
This process repeats for every file in the selected group.
During the replacement process you are informed of your location in the group
of files you are operating on. When you have finished, you are presented with
statistics informing you how many replacements were made and in how many files.
***************************************
* Command Line Reference (Batch Mode) *
***************************************
GSR /? shows the following information:
Batch Mode Specifications:
GSR /F<filespec> /L<lookfor> /R<repwith> /C<Y/N>(case sensitive)
Example: (Parameters must be in /F /L /R [/C] order)
GSR /F*.PRG /LXXyyXX /R123123 /CY
Replace all occurrances of XXyyXX with 123123 in *.PRG
Case sensitive.
Automatic replacement when found.
Case defaults to Not Case Sensitive if not specified.
Batch Mode is always Automatic Replacement.
******************
* Other Features *
******************
GSR will now run in monochrome. Type GSR MONO at the command line.
You can also set a parameter in your AUTOEXEC.BAT file to force monochrome;
SET MONITOR=MONO.
GSRAVOID
Why it's here?
There are many types of files that any length text can be replaced with any
other length, and never cause a problem.
There are many files, however, that allowing a change like this would cause
a disaster. For this reason, I included eighteen file extensions inside GSR
that cannot be written to unless the search text and the replace text are
identical in length.
GSR looks for the file GSRAVOID.DBF in the current directory, and if it finds
it, GSR reads in the file extensions in GSRAVOID instead of using it's
internal list.
This means: If you need to override the default values, you need to modify
GSRAVOID.DBF and put it in the directory where you are working.
This allows you to add to or override my eighteen extensions.
The extensions I avoid internally are:
.COM .EXE .DBF .DBT .NTX .NDX .PAK
.OVL .LIB .OBJ .MEM .SYS .ZIP .ARC
.IDX .MDX .DBV .LZH
Changing the length of any of these types of files would spell certain
disaster. You may add more if you wish by filling in more records in
GSRAVOID.DBF with any dBASE type program. You do NOT need to put GSRAVOID.DBF
in a directory for GSR to work. It only exists so you can override my defaults.
WARNING!
DISCLAIMER:
You are totally responsible for the use of this program. If it causes damage
of any kind, you are responsible. In no way will I, Phil Barnett, assume any
expense or provide any compensation for the use or misuse of this program.
YOU SHOULD ALWAYS MAKE A BACKUP OF THE DIRECTORY YOU ARE WORKING IN
BEFORE YOU BEGIN WITH GSR.
GSR is a tool, nothing more. It can be used in a beneficial way as easily as
a damaging way. I hope you find it of benefit to you. I wished for a program
like this for a long time, and after giving up hope of finding it, I finally
wrote it myself. I use it constantly, and wish I'd had it years ago.
Good Luck, Good Programming, and God Bless You.
My motto: Easier is Better!
MODIFICATONS HISTORY (minor increments indicate that only minor portions
of the code were modified or debugged)
Version 1.62 GSR now sets the DOS errorlevel on exit, to indicate how
many occurrances were replaced. This may be important in
command line usage and batch files.
Compiled in Clipper 5.2d.
Version 1.61 Removed my debugging message (oops!) that prevented GSR
from running in batch mode without user intervention.
Compiled in Clipper 5.2c.
Version 1.60 Rewrote file traversal algorithm.
Rewrote search and replace algorithm.
Switched to Clipper 5.2.
Added functions from Clipper Tools III library.
Dropped all functions from FUNCky library.
Dropped workaround from version 1.56.
Version 1.57 Batch mode left colors in changed state.
Improved Batch Mode to allow spaces in Search and Replace
data.
Version 1.56 Repaired obscure midfile bug. This appears to be from a bug
in the Clipper language itself. A workaround eliminates the
problem.
Version 1.55 Repaired obscure missing trailing bytes bug.
New colors on VGA monitors.
Allowed filespec, lookfor and repwith variables to
remain after each loop.
This version has a Batch Mode interface.
Automatic snow removal on all CGA monitors.
Version 1.54 Further speed enhancements.
Improved Color scheme.
Exploding Boxes.
Shadows by the Hour.
Shadows around boxes act like the hour hand on a clock.
Version 1.53 Erase $temp.$$$ on exit from program.(just to make sure)
On unregistered version, GSR now checks to see if your
printer is ready before printing the registration form.
Save original DOS screen and restore it on termination of
program.
Version 1.52 fixed bug in GSR that ocassionally caused output text to
have sections of it changed to upper case.
Version 1.51 loops back to the main menu and retains last file spec.
Cleaned up the code a little for better performance.
Version 1.5 removed .BAT from avoidance list.
Allowed users to remove snow from older CGA displays.
Stays in program until user requests end of program.
Version 1.4 update added a virtual file manager, making it possible to use GSR
on ANY size of file. This was a total rewrite.
1.4 no longer copies the original file to the backup name.
The original file is now RENAMED to the backup name.
added monochrome switch on the command line:
GSR MONO for monochrome operation on Mono-VGA's
Version 1.3 is the first Shareware version.
added ability to specify 'use files' on disk to fill the search
and replace parameters.
added case sensitivity.
Version 1.2 was the Gamma version
added the c routine that allows rapid context viewing allowing
the new user interface to emulate the Norton Text Search (TS.EXE)
look and feel.
added manual refusal on changes.
Version 1.1 was the Beta version.
Version 1.0 was my original creation, a diamond in the rough.
CREDITS:
Thanks to the generosity of Rusty Justin for making this creation necessary.
(I mean it. Thanks, Rusty!)
Nortons Text Search (TS.EXE) is a copyrighted and trademarked program by
Peter Norton Computing.
I must admit, that I always wished and waited for Peter Norton to upgrade his
TS.EXE program to do what GSR.EXE does. When Peter Norton Computing was
purchased by another company (Symantec), the 5.0 version was released. TS.EXE
was no longer offered as a utility in the 5.0 Advanced Version. By this time,
I knew I would never see Peter Norton Computing create the program I had wished
for. I proceeded to create it.
(further notes: As of Nortons' Version 6.0, TS.EXE was reinstated as a greatly
improved program. Still no replace function....)